import time

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select

driver=webdriver.Chrome()
driver.get('https://sahitest.com/demo/selectTest.htm')

time.sleep(3)
s1=driver.find_element(By.ID,'s1')
select=Select(s1)


#通过索引
time.sleep(2)
select.select_by_index(2)
time.sleep(2)
#通过value
time.sleep(3)
select.select_by_value('48')
time.sleep(2)
#通过文本
time.sleep(2)
select.select_by_visible_text('Mail')

driver.quit()

